package ch.il07.converter.business;

public interface UserBusiness extends Service {
	/**
	 * Checks if given password matches with given username.
	 * @param username Username from form
	 * @param password Password from form
	 * @return true when login is correct, else false
	 */
	public boolean login(String username, String password);
	
	/**
	 * Registers a new user.
	 * {UseCase "Registrieren"}
	 * @param username Nickname
	 * @param password Password (plain text)
	 * @param email Email (have to be valid)
	 * @param accessLevel Numbers defined in ch.il07.converter.entities.AccessLevel
	 * @return true when user registration was successful, else false
	 */
	public boolean register(String username, String password, String email, Integer accessLevel);
	
	/**
	 * Changes the password of the given user when oldPassword matches is the (current) correct password.
	 * {UseCase "Persönliche Daten ändern"}
	 * @param username Nickname
	 * @param oldPassword The current, correct password (plain text)
	 * @param newPassword The new password (plain text)
	 * @return True when password is changed, else false
	 */
	public boolean changePassword(String username, String oldPassword, String newPassword);
	
	/**
	 * 
	 * @param username
	 * @return True on success
	 */
	public boolean deleteUser(String username, String password);
	
	public boolean isAdministrator(String username, String password);

}
		
